package com.takanafu.haru.code{
	import com.takanafu.haru.code.CodeBase;
	
	public class CodeWhile extends CodeBase{
		private var cond:CodeBase;
		private var body:CodeBase;
		
		public function CodeWhile(code:CodeBase,body:CodeBase){
			this.cond = code;
			this.body = body;
		}
		override public function run():CodeBase{
			var c:CodeBase = null;
			
			while(this.cond.run() != CodeBoolean.False){
				c = this.body.run();
			}
			return c;
		}
	}
}